/*
* TFAIInterface.h
*
* This class can calculate computer turns using
* artificial intelligence.
* 
* Author: Rapid Dojo
* Date: Oct 19, 2007
*/

#ifndef TFAIInterface_H
#define TFAIInterface_H

#include "TFConstants.h"
#include "TFModelInterface.h"
#include "TFRuleCheckerInterface.h"
#include "TFBoard.h"
#include "TFGameMoveList.h"

class TFAIInterface
{
public:

	/*
	*
	*/
	virtual HRESULT SetupBoard(TF_PLAYERS iColor){return E_FAIL;}

	/*
	* Do a turn by using the model
	*/
	virtual HRESULT DoTurn(int iPoints, TFGameMoveList & oListOfMoves){return E_FAIL;}

	/*
	* The AI needs the model to calculate its move
	*/
	virtual void SetModel(TFModelInterface * iTFModel){_model = iTFModel;}

	/*
	* Uses x1,y1 from initialPosition
	* returns a list of moves (x1,y1 will be valid positions)
	* useTarget boolean will determin if a direction will be considered
	*/
	void GetPotentialMoves(TFGameMove &initialPosition, TFGameMove &iTarget, TFGameMoveList &oMoveList, bool useTarget = true);
 
	/*
	* Needs access to the rules
	*/
	virtual void SetRuleChecker(TFRuleCheckerInterface * iTFRulechecker){_ruleChecker = iTFRulechecker;}

	/*
	*
	*/
	virtual HRESULT PlacePieces(TFBoard *& ioBoard, int numPoints, int behavior = 0) { return E_FAIL;}

	virtual ~TFAIInterface(){}

protected:
  TFModelInterface * _model;
  TFRuleCheckerInterface * _ruleChecker;
};

#endif
